package com.cheng.config;

import org.jasypt.util.text.BasicTextEncryptor;

/**
 * 配置文件加密工具类
 * @author cheng-qiang
 * @date 2022年08月11日17:20
 */
public class JasyptUtil {

    public static void main(String[] args) {
        String account = "bw4vqrtvy6am";
        String password = "pscale_pw_SaqayyYxogNcJ93dvlQ0tfduFHloZBDlBf7Mu_r7Bj8";
        BasicTextEncryptor encryptor = new BasicTextEncryptor();
        //秘钥
        //encryptor.setPassword(System.getProperty("jasypt.encryptor.password"));
        encryptor.setPassword("eug83f3gG");
        //密码进行加密
        String newAccount = encryptor.encrypt(account);
        String newPassword = encryptor.encrypt(password);
        System.out.println("加密后账号：" + newAccount);
        System.out.println("加密后密码：" + newPassword);
    }
}
